package org.baseflexcharts.shapes
{
	import mx.core.UIComponent;
	
	public class Rectangle extends UIComponent
	{		
		private var _color:uint;
		
		private var _tip:String;
		
		public function Rectangle(width:Number, height:Number, color:uint = 0x000000, tip:String = "")
		{
			this.width = width;
			this.height = height;
			this.color = color;
			this.tip = tip;
			draw();
		}
		
		public function draw():void
		{
			this.graphics.clear();
			this.graphics.lineStyle(1, color, 1);
			this.graphics.moveTo(0, 0);
			this.graphics.beginFill(color);
			this.graphics.lineTo(this.width, 0);
			this.graphics.lineTo(this.width, this.height);
			this.graphics.lineTo(0, this.height);
			this.graphics.endFill();
			
			this.toolTip = tip;
		}
		
		public function get color():uint
		{
			return this._color;
		}
		
		public function set color(data:uint):void
		{
			this._color = data;
		}
		
		public function get tip():String
		{
			return this._tip;
		}
		
		public function set tip(data:String):void
		{
			this._tip = data;
		}		
	}
}